package com.demo.study.thread;

/**
 * @author leiliang
 * @version 1.0
 * @Description
 * @date 2021/1/5 18:03
 */
public class TicketThread implements  Runnable {

    private    int count = 100;

    @Override
    public void run() {
        while (count >0){
            System.out.println(Thread.currentThread().getName()+"，正在出票"+ (100 - count +1 )+"张");
            count --;
        }
    }

    public static void main(String[] args) {
        TicketThread ticketThread = new TicketThread();
        new Thread(ticketThread,"窗口1").start();
        new Thread(ticketThread,"窗口2").start();
    }
}
